﻿using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LoggerSystem
{
    public class NLoggerPrint
    {
        private readonly ILogger<NLoggerPrint> logger;

        public NLoggerPrint(ILogger<NLoggerPrint> logger) { 
         this.logger = logger;
        }

        public void PrintLogger()
        {
            try
            {
                var content = File.ReadAllText("c://1.txt");
                Console.WriteLine(content);
            }
            catch(Exception ex )
            {
                logger.LogError(ex,"系统异常错误消息");
            }
        }
    }
}
